package com.HomeWorkhsp.chapter13.wrapper;

public class WrapperExercise01 {
    public static void main(String[] args) {
        Double d = 100d;//自动封装，Double.valueOf(100d)
        Float f = 1.5f;//自动封装，Float.valueOf(1.5f)

        Object obj1 = true ? new Integer(1) : new Double(2.0);
        //输出的是1.0，因为三元运算符是一个整体
        System.out.println(obj1);

        Object obj2;
        if (true)
            obj2 = new Integer(1);//这里输出1
        else
            obj2 = new Double(2.0);
        System.out.println(obj2);
    }
}
